{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6aa89160-11d5-48db-88a1-66827ed5835d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3x4的数组: \n",
      " [[110 120  90  80]\n",
      " [ 89  95  77  92]\n",
      " [ 60  79  96  80]]\n",
      "第三行和第一行的元素: \n",
      " [[ 60  79  96  80]\n",
      " [110 120  90  80]]\n",
      "第3行第2列和第1行第1列的元素, [ 79 110]\n",
      "大于80且小于等于100的所有元素: [90 89 95 92 96]\n",
      "小于等于80的所有元素: [80 77 60 79 80]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr = np.array([[110,120,90,80],[89,95,77,92],[60,79,96,80]])\n",
    "print('3x4的数组: \\n',arr)\n",
    "print('第三行和第一行的元素: \\n',arr[[2,0]])\n",
    "print('第3行第2列和第1行第1列的元素,',arr[[2,0],[1,0]])\n",
    "print('大于80且小于等于100的所有元素:',arr[(arr>80)&(arr<=100)])\n",
    "print('小于等于80的所有元素:',arr[arr<=80])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "afd99aef-bbee-450e-8f06-ee976b27bfe5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
